use replication, clear

// coding of whether script had personal encouragement or not
gen encouraged = 1 if treatment_script_name == "wewantyou"
replace encouraged = 1 if treatment_script_name == "youdbegreat"
replace encouraged = 0 if treatment_script_name == "helprunning"
replace encouraged = 0 if treatment_script_name == "youcanwin"

// Table 3 top panel
bysort encouraged: tab treatment_script_name
tabstat opened, by(treatment_script_name) s(mean sem)
tabstat clicked if opened == 1, by(treatment_script_name) s(mean sem)
tabstat clicked, by(treatment_script_name) s(mean sem) // also Figure 1 left panel
tabstat pledged, by(treatment_script_name) s(mean sem) // also Figure 1 right panel

// Table 3 bottom panel
reg opened encouraged
reg clicked encouraged if opened == 1
reg clicked encouraged
reg pledged encouraged

